package pos.storage;

import pos.interfaces.Database;
import pos.interfaces.Storage;
import pos.storage.db.DBFactory;

/**
 * Factory method to create Storage objects. This uses FactoryMethod design patterns to interact with the data store
 * @author srikanth ramu
 */
public class StorageFactory implements Storage{
    
        /**
	 * Instantiates the implementing class based on a condition.
	 * @param type
	 * @return
	 */
	public static Storage getStorage(String type, String objType){
                //Creation Database storage objects
		if(type.equals(Storage.DBTYPE)){
                        if(objType.equals(Database.MYSQL)){
                            Storage mysqlstorage = DBFactory.getDatabase(Database.MYSQL);
                            return mysqlstorage;
                        }
		}
		return null;
	}
}
